import request from '@/utils/request'

/**
 * @description: 获取客户详情
 * @param {*} params
 * @return {*}
 */
export function getCompanyDetail(params) {
  return request({
    url: '/company/detail',
    method: 'get',
    params
  })
}

/**
 * @description: 获取公司账户清单
 * @param {*} params
 * @return {*}
 */
export function getCommanyAccountList(params) {
  return request({
    url: '/compant/account/list',
    method: 'get',
    params
  })
}

/**
 * @description: 验证账户等级以进行后续操作
 * @param {*} data
 * @return {*}
 */
export function validateAccountLv(data) {
  return request({
    url: '/company/validate/lv',
    method: 'post',
    data
  })
}

/**
 * @description: 获取当前公司的相关权限
 * @param {*} params
 * @return {*}
 */
export function getCompanyPermission(params) {
  return request({
    url: '/company/permissons',
    method: 'get',
    params
  })
}

/**
 * @description: 添加公司用户
 * @param {*} data
 * @return {*}
 */
export function addCompanyAccount(data) {
  return request({
    url: '/company/account/add',
    method: 'post',
    data
  })
}

/**
 * @description: 验证用户数是否充足
 * @param {*} data
 * @return {*}
 */
export function validateCompanyCanUse(data) {
  return request({
    url: '/company/validate/tree',
    method: 'post',
    data
  })
}

/**
 * @description: 获取用户的资料信息
 * @param {*} params
 * @return {*}
 */
export function getCompanyAccountDetail(params) {
  return request({
    url: '/company/account/detail',
    method: 'get',
    params
  })
}

/**
 * @description: 更新用户信息
 * @param {*} params
 * @return {*}
 */
export function updateCompanyAccountDetail(data) {
  return request({
    url: '/company/account/update',
    method: 'post',
    data
  })
}

/**
 * @description: 删除用户信息
 * @param {*} data
 * @return {*}
 */
export function deleteCompanyAccount(data) {
  return request({
    url: '/company/account/delete',
    method: 'post',
    data
  })
}
